package com.hulk.lockd.config;

import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * Created hulk  on 2019/05/28.
 */
@Data
@Accessors(chain = true)
@ConfigurationProperties(prefix = LockdProperties.PREFIX)
public class LockdProperties {

    public static final String PREFIX = "spring.lockd";
    //redisson
    private String address;
    private String password;
    private int database = 0;
    private ClusterServer clusterServer;
    private String codec = "org.redisson.codec.JsonJacksonCodec";
    //lock
    private long acquireTimeout = 60;
    private long expire = 60;



    public ClusterServer getClusterServer() {
        return clusterServer;
    }

    public void setClusterServer(ClusterServer clusterServer) {
        this.clusterServer = clusterServer;
    }

    public static class ClusterServer{

        private String[] nodeAddresses;

        public String[] getNodeAddresses() {
            return nodeAddresses;
        }

        public void setNodeAddresses(String[] nodeAddresses) {
            this.nodeAddresses = nodeAddresses;
        }
    }
}
